package com.kakarote.examine.constant;

import com.kakarote.core.common.enums.SystemCodeEnum;
import com.kakarote.core.exception.CrmException;

import java.util.Objects;

//异常处理类型1：自动同意2：转交给指定人员处理
public enum NodeHandleTypeEnum {

    //1：自动同意
    AUTO_PASS(1),
    //2：转交给指定人员处理
    FORWARD_OTHERS(2);

    private NodeHandleTypeEnum(Integer type) {
        this.type = type;
    }

    private Integer type;

    public Integer getType() {
        return type;
    }

    public static NodeHandleTypeEnum valueOf(Integer type) {
        for (NodeHandleTypeEnum nodeHandleTypeEnum : values()) {
            if (Objects.equals(type, nodeHandleTypeEnum.getType())) {
                return nodeHandleTypeEnum;
            }
        }
        throw new CrmException(SystemCodeEnum.SYSTEM_NO_VALID);
    }
}
